package org.testing;

import java.io.Serializable;

public class Card implements Serializable
{
	private String base,word1,word2,word3,word4,word5,word6;
	private int numDifficultyRatings,numOverallRatings,difficultyRating,overallRating;
	
	  /**
     * Sole constructor.
     */
	public Card(String sBase,String sWord1,String sWord2,String sWord3,String sWord4,
			String sWord5,String sWord6,int sdifficultyRating,int soverallRating)
	{
		base=sBase;
		word1=sWord1;
		word2=sWord2;
		word3=sWord3;
		word4=sWord4;
		word5=sWord5;
		word6=sWord6;
		difficultyRating=sdifficultyRating;
		overallRating=soverallRating;
		//numRatings=(overallRating==0 ? 0 : 1);
		numDifficultyRatings=1;
		
		/*
		 * TODO
		 * should be 0
		 * need to find a way to resolve this
		 */
		numOverallRatings=1;
	}
	
	/**
	 * increases the number of ratings of Difficulty the card has
	 */
	public void incNumDifficultyRatings()
	{
		numDifficultyRatings++;
	}
	
	/**
	 * increases the number of ratings of OverallRatings the card has
	 */
	public void incNumOverallRatings()
	{
		numOverallRatings++;
	}
	
	/**
	 * gets the number of ratings that difficulty has
	 *
	 * @return	numDifficultyRatings
	 */
	public int getNumDifficultyRatings()
	{
		return numDifficultyRatings;
	}
	
	/**
	 * gets the number of ratings that overallRatings has
	 *
	 * @return	numOverallRatings
	 */
	public int getNumOverallRatings()
	{
		return numOverallRatings;
	}
	
	/**
	 * gets the base taboo word
	 *
	 * @return	base
	 */
	public String getBase()
	{
		return base;
	}
	
	/**
	 * gets the 1st taboo word
	 *
	 * @return	word1
	 */
	public String getWord1()
	{
		return word1;
	}
	
	/**
	 * gets the 2st taboo word
	 *
	 * @return	word2
	 */
	public String getWord2()
	{
		return word2;
	}
	
	/**
	 * gets the 3rd taboo word
	 *
	 * @return	word3
	 */
	public String getWord3()
	{
		return word3;
	}
	
	/**
	 * gets the 4th taboo word
	 *
	 * @return	word4
	 */
	public String getWord4()
	{
		return word4;
	}
	
	/**
	 * gets the 5th taboo word
	 *
	 * @return	word5
	 */
	public String getWord5()
	{
		return word5;
	}
	
	/**
	 * gets the 6th taboo word
	 *
	 * @return	word6
	 */
	public String getWord6()
	{
		return word6;
	}
	
	/**
	 * gets total rating of difficulty
	 *
	 * @return	difficultyRating
	 */
	public int getDifficultyRating()
	{
		return difficultyRating;
	}
	
	/**
	 * gets the total rating of OverallRating
	 *
	 * @return	overallRating
	 */
	public int getOverallRating()
	{
		return overallRating;
	}
	
	/**
	 * determines the actual Difficulty Rating
	 *
	 * @return	difficultyRating/numDifficultyRatings
	 */
	public double getDifficultyRatingAvg()
	{
		if(numDifficultyRatings!=0)
		{
			return difficultyRating/numDifficultyRatings;
		}
		else
		{
			System.out.println("no difficulty ratings");
			return 0;
		}
	}
	
	/**
	 * determines the actual overall Rating
	 *
	 * @return	overallRating/numOverallRatings;
	 */
	public double getOverallRatingAvg()
	{
		return overallRating/numOverallRatings;
	}
	
	/**
	 * sets the base word
	 *
	 * @param  a  	base word
	 */
	public void setBase(String a)
	{
		base=a;
	}
	
	/**
	 * sets the first word
	 *
	 * @param  a  	word1
	 */
	public void setWord1(String a)
	{
		word1=a;
	}
	
	/**
	 * sets the second word
	 *
	 * @param  a  	word2
	 */
	public void setWord2(String a)
	{
		word2=a;
	}
	
	/**
	 * sets the third word
	 *
	 * @param  a  	word3
	 */
	public void setWord3(String a)
	{
		word3=a;
	}
	
	/**
	 * sets the fourth word
	 *
	 * @param  a  	word4
	 */
	public void setWord4(String a)
	{
		word4=a;
	}
	
	/**
	 * sets the fifth word
	 *
	 * @param  a  	word5
	 */
	public void setWord5(String a)
	{
		word5=a;
	}
	
	
	/**
	 * sets the sixth word
	 *
	 * @param  a  	word6
	 */
	public void setWord6(String a)
	{
		word6=a;
	}
	
	/**
	 * increments the total difficulty rating
	 *
	 * @param  a  	difficultyRating
	 */
	public void setDifficultyRating(int a)
	{
		difficultyRating+=a;
	}
	
	/**
	 * increments the total overall rating
	 *
	 * @param  a  	overallRating
	 */
	public void setOverallRating(int a)
	{
		overallRating+=a;
	}
}